package com.exam.scjp5.objectives.section_1;

public class ExampleOverloading2
{
    public static void method(Hero h)
    {
        System.out.println("method(Hero h);");
    }

    public static void method(Paladin p)
    {
        System.out.println("method(Paladin p);");
    }

    public static void method(HolyPaladin p)
    {
        System.out.println("method(HolyPaladin p);");
    }

    public static void main(String args[])
    {
        Hero h = new Paladin();
        Druid d = new Druid();
        Paladin p = new Paladin();
        method(p);
        method(h);
        method(d);
        method(null);
    }
}

class Hero
{
}

class Paladin extends Hero
{
}

class HolyPaladin extends Paladin
{
}

class Druid extends Hero
{
}